#include <stdio.h>
#include <pthread.h>

pthread_mutex_t mutex = PTHREAD_MUTEX_INITIALIZER;

void* test(void* arg)
{
    pthread_mutex_lock(&mutex);
    pthread_mutex_lock(&mutex);

    pthread_exit(nullptr);
}

int main()
{
    pthread_t tid;
    pthread_create(&tid, nullptr, test, nullptr);
    pthread_join(tid, nullptr);

    return 0;
}
